package com.ess.constants;

import java.util.ArrayList;
import java.util.List;

/**
 * 系统编码常用工具类
 */
public class Constants {

    public static final String STRING_ZERO = "0";
    public static final String STRING_ONE = "1";
    public static final String STRING_TWO = "2";
    public static final String STRING_THREE = "3";
    public static final String STRING_FOUR = "4";
    public static final String STRING_FIVE = "5";
    public static final String STRING_SIX = "6";

    public static final int INT_ZERO = 0;
    public static final int INT_ONE = 1;
    public static final int INT_TEN = 10;

    public static final String FLAG_SAVE = "save";
    public static final String FLAG_UPDATE = "update";
    public static final String ORDER_UPDATE_DESC = " updateDate desc ";
    public static final String ORDER_SORT_DESC = " sort asc ";
    
    /**
     * 主数据表名
     *
     * @author mingfei.z
     */
    public static final class MDM_TABLE_NAME {
    	
    	/** 地址表： MDM_DISTRICT*/
    	public static final String MDM_DISTRICT = "MDM_DISTRICT";

    	/** 基础类目表： MDM_CATEGORY*/
    	public static final String MDM_CATEGORY = "MDM_CATEGORY";
    	
    }
    
    /**
     * 国家CODE/名称
     *
     * @author mingfei.z
     */
    public static final class NATION_INFO {
    	
    	/** 中国CODE： CN*/
    	public static final String CHINA_CODE = "CN";

    	/** 中国名称： 中国*/
    	public static final String CHINA_NAME = "中国";
    	
    }

    /**
     * 数据来源
     *
     * @author mingfei.z
     */
    public static final class DATA_SOURCE {
    	
    	/** 主数据推送：MDM*/
    	public static final String FROM_MDM = "MDM";

    	/** 定期从SAP获取：JOB */
    	public static final String FROM_JOB = "JOB";

    	/** 定期从SAP获取，Mq处理：JOB-MQ */
    	public static final String FROM_JOB_MQ = "JOB-MQ";

    	/** Mq 异步推送：MQ */
    	public static final String FROM_MQ = "MQ";

    }

    /**
     * 操作类型
     *
     * @author mingfei.z
     */
    public static final class OPERATE_TYPE {
    	
    	/** MDM_NATION_REGION*/
    	public static final String MDM_NATION_REGION = "MDM_NATION_REGION";
    	
    	/** MDM_CATEGORY_BASE*/
    	public static final String MDM_CATEGORY_BASE = "MDM_CATEGORY_BASE";
    	
    	/** SAP_GOODS_DATA*/
    	public static final String SAP_GOODS_DATA = "SAP_GOODS_DATA";

    	/** SAP_PRICE_COST_DATA*/
    	public static final String SAP_PRICE_COST_DATA = "SAP_PRICE_COST_DATA";

    	/** SAP_PRICE_SALE_DATA*/
    	public static final String SAP_PRICE_SALE_DATA = "SAP_PRICE_SALE_DATA";

    	/** PUSH_PRICE_TAGS_TO_ELEC*/
    	public static final String PUSH_PRICE_TAGS_TO_ELEC = "PUSH_PRICE_TAGS_TO_ELEC";

    }

	/**
	 * 转换成Object
	 * @param list
	 * @param <E>
	 * @return
	 */
	public static <E> List<Object> toObject(List<E> list) {
		List<Object> objlist = new ArrayList<>();
		for (Object e : list) {
			Object obj = (Object) e;
			objlist.add(obj);
		}
		return objlist;
	}

    /**
     * 删除状态
     *
     * @author mingfei.z
     */
    public static final class DELETE_STATUS {
    	
    	/** 已删除：1 */
    	public static final int YES_INT = 1;
    	
    	/** 未删除：0 */
    	public static final int NO_INT = 0;

    	/** 已删除：1 */
    	public static final byte YES_BYTE = 1;
    	
    	/** 未删除：0 */
    	public static final byte NO_BYTE = 0;

    }

    /**
     * SPU、SKU审核状态
     *
     * @author mingfei.z
     */
    public static final class REVIEW_STATUS {
    	
    	/** 草稿：-1 */
    	public static final int DRAFT = -1;

    	/** 草稿：-1 */
    	public static final byte DRAFT_BYTE = -1;
    	
    	/** 待审核：0 */
    	public static final int WAIT = 0;

    	/** 待审核：0 */
    	public static final byte WAIT_BYTE = 0;

    	/** 审核通过：1 */
    	public static final int SUCCESS = 1;

    	/** 审核通过：1 */
    	public static final byte SUCCESS_BYTE = 1;
    	
    	/** 审核不通过：2 */
    	public static final int FAIL = 2;

    	/** 审核不通过：2 */
    	public static final byte FAIL_BYTE = 2;

    }

    /**
     * SAP物料调取状态
     *
     * @author mingfei.z
     */
    public static final class TRANSFER_STATUS {
    	
    	/** 未调取：0 */
    	public static final int NO = 0;

    	/** 已调取：1 */
    	public static final byte YES = 1;

    	/** 未调取：0 */
    	public static final byte NO_BYTE = 0;

    	/** 已调取：1 */
    	public static final byte YES_BYTE = 1;
    	
    }

    /**
     * 商品类型
     *
     * @author mingfei.z
     */
    public static final class GOODS_TYPE {
    	
    	/** 代售：0 */
    	public static final int OTHER = 0;

    	/** 自营：1 */
    	public static final byte SELF = 1;
    	
    }

    /**
     * 码表
     *
     * @author mingfei.z
     */
    public static final class SYSTEM_CODE {
    	
    	/** 主数据同步地址开关 */
    	public static final String TYPE_MDM_REGION = "MDM_REGION";

    	/** 主数据同步地址开关：1-开 */
    	public static final String MDM_REGION_ON = "1";

    	/** 主数据同步地址开关：0-关 */
    	public static final String MDM_REGION_OFF = "0";

    	/** 控制是否取SAP全量数据，1-取全量，0-取增量：OBTAIN_SAP_ALL_DATA */
    	public static final String TYPE_OBTAIN_SAP_ALL_DATA = "OBTAIN_SAP_ALL_DATA";

    	/** 控制是否取SAP全量数据: 1-取全量 */
    	public static final String OBTAIN_SAP_ALL_DATA_YES = "1";

    	/** 控制是否取SAP全量数据: 0-取增量 */
    	public static final String OBTAIN_SAP_ALL_DATA_NO = "0";

    	/** 计价单位类型：unit */
    	public static final String CODE_TYPE_UNIT = "unit";

    	/** 等级类型：product_lv */
    	public static final String CODE_TYPE_PRODUCT_LV = "product_lv";

    	/** 规格单位类型：standard_unit */
    	public static final String CODE_TYPE_STANDARD_UNIT = "standard_unit";

    	/** 家具分类-需基材、辅材、饰面：category_furniture */
    	public static final String CODE_TYPE_CATEGORY_FURNITURE = "category_furniture";

    	/** 价格类型：price_tpye */
    	public static final String CODE_TYPE_PRICE_TPYE = "price_tpye";

    	/** 是否支持退换货：refund_type */
    	public static final String CODE_TYPE_REFUND_TYPE = "refund_type";
    	
    }

    /**
     * 启用/禁用状态
     *
     * @author mingfei.z
     */
    public static final class ENABLE {
    	
    	/** 启用：1 */
    	public static final int YES_INT = 1;
    	
    	/** 禁用：0 */
    	public static final int NO_INT = 0;

    	/** 启用：1 */
    	public static final byte YES_BYTE = 1;
    	
    	/** 禁用：0 */
    	public static final byte NO_BYTE = 0;

    }

    /**
     * 上架/下架状态
     *
     * @author mingfei.z
     */
    public static final class SALE_STATUS {
    	
    	/** 上架：1 */
    	public static final int UP_INT = 1;
    	
    	/** 下架：0 */
    	public static final int DOWN_INT = 0;

    	/** 上架：1 */
    	public static final byte UP_BYTE = 1;
    	
    	/** 下架：0 */
    	public static final byte DOWN_BYTE = 0;

    }

    /**
     * 电子价签相关常量
     *
     * @author mingfei.z
     */
    public static final class PRICE_TAG {
    	
    	/** domain常量前缀：HX. */
    	public static final String DOMAIN_PREFIX = "HX.";
    	
    	/** 模板类型：0：普通模板 */
    	public static final String TAG_TYPE_0 = "0";

    	/** 模板类型：1: 促销模板  */
    	public static final String TAG_TYPE_1 = "1";
    	
    }

    /**
     * 价格常量
     *
     * @author mingfei.z
     */
    public static final class PRICE_TYPE {
    	
    	/** 成本价：1 */
    	public static final int COST = 1;

    	/** 销售价：2  */
    	public static final int SALE = 2;
    	
    }

    /**
     * 符号常量
     *
     * @author mingfei.z
     */
    public static final class SYMBOLE {
    	
    	/** 中文逗号 */
    	public static final String DOT_ZH = "，";

    	/** 英文逗号  */
    	public static final String DOT_EN = ",";
    	
    }

    /**
     * 商品属性类型常量
     *
     * @author mingfei.z
     */
    public static final class GOODS_ATTR_TYPE {
    	
    	/** 输入框类型 */
    	public static final String TEXT = "text";

    	/** 单选  */
    	public static final String RADIO = "radio";

    	/** 多选  */
    	public static final String MULTIPLE = "multiple";

    	/** 图片  */
    	public static final String IMG = "img";
    	
    }

    /**
     * 商品销售渠道常量
     *
     * @author mingfei.z
     */
    public static final class GOODS_PLATFORM {
    	
    	/** 线上渠道 */
    	public static final int ONLINE = 2;

    	/** 线下渠道  */
    	public static final int OFFLINE = 0;

    	/** 全渠道  */
    	public static final int ON_AND_OFFLINE = 1;
    	
    }
    
    /**
     * 微信小程序相关变量
     *
     * @author mingfei.z
     */
    public static final class WX_ACODE {
    	
    	/** 微信小程序接口A */
    	public static final int INTERFACE_A = 1;

    	/** 微信小程序接口B  */
    	public static final int INTERFACE_B = 2;

    	/** 微信小程序接口C  */
    	public static final int INTERFACE_C = 3;
    	
    }
    
    
}
